using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PACKETPARSERMAX20.CORE
{
	public class quest_poi_points : MangosBase
	{
		public System.UInt32? questid;
		public System.Byte? poiid;
		public System.Int32? x;
		public System.Int32? y;




		public override string GetInsertCommand()
		{
			return string.Format("INSERT IGNORE INTO `quest_poi_points` (`questid`, `poiid`, `x`, `y`) VALUES ('{0}', '{1}', '{2}', '{3}');", questid.GetValueOrDefault(), poiid.GetValueOrDefault(), x.GetValueOrDefault(), y.GetValueOrDefault());
		}


		public override string GetUpdateCommand()
		{
            StringBuilder sb = new StringBuilder();
						sb.Append("UPDATE `quest_poi_points` SET ");
			if(poiid != null)
			{
				sb.AppendLine("`poiid`='" + poiid.Value.ToString() + "'");
			}
			if(x != null)
			{
				sb.AppendLine("`x`='" + x.Value.ToString() + "'");
			}
			if(y != null)
			{
				sb.AppendLine("`y`='" + y.Value.ToString() + "'");
			}
				sb = sb.Replace("\r\n", ", ");
				sb.Append(" WHERE `questid`='" + questid.Value.ToString() + "';");
				sb = sb.Replace(",  WHERE", " WHERE");

            return sb.ToString();
		}


	}
}
